% define in-prose representations for lots of generators

%%%%REVERSED BY BOB %%%%%%%%

\newcommand{\dotcounit}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=-1mm]
\node [#1] (a) at (0,0.25) {}; 
\draw [medium diredge] (0,-0.2)--(a);
\end{tikzpicture}\,}
\newcommand{\dotunit}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=1.5mm]
\node [#1] (a) at (0,-0.25) {}; 
\draw [medium diredge] (a)--(0,0.2);
\end{tikzpicture}\,}
\newcommand{\dotcomult}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=0.5mm]
	\node [#1] (a) {};
	\draw [medium diredge] (-90:0.55)--(a);
	\draw [medium diredge] (a) -- (45:0.6);
	\draw [medium diredge] (a) -- (135:0.6);
\end{tikzpicture}\,}
\newcommand{\dotmult}[1]{%
\,\begin{tikzpicture}[dotpic]
	\node [#1] (a) {};
	\draw [medium diredge] (a) -- (90:0.55);
	\draw [medium diredge] (a) (-45:0.6) -- (a);
	\draw [medium diredge] (a) (-135:0.6) -- (a);
\end{tikzpicture}\,}

%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\dotidualiser}[1]{%
\begin{tikzpicture}[dotpic,yshift=1.5mm]
	\node [#1] (a) {};
	\draw [medium diredge] (a) to (-90:0.35);
	\draw [medium diredge] (a) to (90:0.35);
\end{tikzpicture}}
\newcommand{\dotdualiser}[1]{%
\begin{tikzpicture}[dotpic,yshift=1.5mm]
	\node [#1] (a) {};
	\draw [medium diredge] (-90:0.35) to (a);
	\draw [medium diredge] (90:0.35) to (a);
\end{tikzpicture}}
\newcommand{\dottickunit}[1]{%
\begin{tikzpicture}[dotpic,yshift=-1mm]
\node [#1] (a) at (0,0.35) {}; 
\draw [postaction=decorate,
       decoration={markings, mark=at position 0.3 with \edgetick},
       decoration={markings, mark=at position 0.85 with \edgearrow}] (a)--(0,-0.25);
\end{tikzpicture}}
\newcommand{\dottickcounit}[1]{%
\begin{tikzpicture}[dotpic,yshift=1mm]
\node [#1] (a) at (0,-0.35) {}; 
\draw [postaction=decorate,
       decoration={markings, mark=at position 0.8 with \edgetick},
       decoration={markings, mark=at position 0.45 with \edgearrow}] (0,0.25) -- (a);
\end{tikzpicture}}
\newcommand{\dotonly}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=-0.3mm]
\node [#1] (a) at (0,0) {};
\end{tikzpicture}\,}
%NEW:
\newcommand{\smalldotonly}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=-0.15mm]
\node [#1] (a) at (0,0) {};
\end{tikzpicture}\,}
%
\newcommand{\dotthreestate}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=2.5mm]
	\node [#1] (a) at (0,0) {};
	\draw (a) -- (0,-0.6);
	\draw [bend right] (a) to (-0.4,-0.6) (0.4,-0.6) to (a);
\end{tikzpicture}\,}
\newcommand{\dotcap}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=2.5mm]
	\node [#1] (a) at (0,0) {};
	\draw [bend right,medium diredge] (a) to (-0.4,-0.6);
	\draw [bend left,medium diredge] (a) to (0.4,-0.6);
\end{tikzpicture}\,}
\newcommand{\dotcup}[1]{%
\,\begin{tikzpicture}[dotpic,yshift=4mm]
	\node [#1] (a) at (0,-0.6) {};
	\draw [bend right,medium diredge] (-0.4,0) to (a);
	\draw [bend left,medium diredge] (0.4,0) to (a);
\end{tikzpicture}\,}

% this doesn't have a colour
\newcommand{\tick}{%
\,\,\begin{tikzpicture}[dotpic]
	\node [style=none] (a) at (0,0.35) {};
	\node [style=none] (b) at (0,-0.35) {};
	\draw [dirtickedge] (a) -- (b);
\end{tikzpicture}\,\,}

% these only make sense in black
\newcommand{\lolli}{%
\,\begin{tikzpicture}[dotpic,yshift=-1mm]
	\path [use as bounding box] (-0.25,-0.25) rectangle (0.25,0.5);
	\node [style=dot] (a) at (0, 0.15) {};
	\node [style=none] (b) at (0, -0.25) {};
	\draw [medium diredge] (a) to (b.center);
	\draw [diredge, out=45, looseness=1.00, in=135, loop] (a) to ();
\end{tikzpicture}\,}

\newcommand{\cololli}{%
\,\begin{tikzpicture}[dotpic]
	\path [use as bounding box] (-0.25,-0.5) rectangle (0.25,0.5);
	\node [style=none] (a) at (0, 0.5) {};
	\node [style=dot] (b) at (0, 0) {};
	\draw [diredge, in=-45, looseness=2.00, out=-135, loop] (b) to ();
	\draw [medium diredge] (a.center) to (b);
\end{tikzpicture}\,}

% BLACK DOTS
\newcommand{\blackdot}{\dotonly{dot}}
\newcommand{\smallblackdot}{\smalldotonly{smalldot}}%NEW
\newcommand{\unit}{\dotunit{dot}}
\newcommand{\counit}{\dotcounit{dot}}
\newcommand{\mult}{\dotmult{dot}}
\newcommand{\comult}{\dotcomult{dot}}
\newcommand{\tickunit}{\dottickunit{dot}}
\newcommand{\tickcounit}{\dottickcounit{dot}}
\newcommand{\dualiser}{\dotdualiser{dot}}
\newcommand{\idualiser}{\dotidualiser{dot}}
\newcommand{\threestate}{\dotthreestate{dot}}
\newcommand{\blackcap}{\dotcap{dot}}
\newcommand{\blackcup}{\dotcup{dot}}

\newcommand{\blackobs}{\ensuremath{\mathcal O_{\!\smallblackdot}}\xspace}

% WHITE DOTS
\newcommand{\whitedot}{\dotonly{white dot}}
\newcommand{\smallwhitedot}{\smalldotonly{smallwhitedot}}%NEW
\newcommand{\whiteunit}{\dotunit{white dot}}
\newcommand{\whitecounit}{\dotcounit{white dot}}
\newcommand{\whitemult}{\dotmult{white dot}}
\newcommand{\whitecomult}{\dotcomult{white dot}}
\newcommand{\whitetickunit}{\dottickunit{white dot}}
\newcommand{\whitetickcounit}{\dottickcounit{white dot}}
\newcommand{\whitecap}{\dotcap{white dot}}
\newcommand{\whitecup}{\dotcup{white dot}}


\newcommand{\whiteobs}{\ensuremath{\mathcal O_{\!\smallwhitedot}}\xspace}


% ALTERNATE WHITE DOTS
\newcommand{\altwhitedot}{\dotonly{alt white dot}}
\newcommand{\altwhiteunit}{\dotunit{alt white dot}}
\newcommand{\altwhitecounit}{\dotcounit{alt white dot}}
\newcommand{\altwhitemult}{\dotmult{alt white dot}}
\newcommand{\altwhitecomult}{\dotcomult{alt white dot}}
\newcommand{\altwhitetickunit}{\dottickunit{alt white dot}}
\newcommand{\altwhitetickcounit}{\dottickcounit{alt white dot}}
\newcommand{\altwhitecap}{\dotcap{alt white dot}}
\newcommand{\altwhitecup}{\dotcup{alt white dot}}

% GRAY DOTS
\newcommand{\graydot}{\dotonly{gray dot}}
\newcommand{\smallgraydot}{\smalldotonly{smallgraydot}}%NEW
%\newcommand{\graysmalldot}{\smalldotonly{gray dot}}
\newcommand{\grayunit}{\dotunit{gray dot}}
\newcommand{\graycounit}{\dotcounit{gray dot}}
\newcommand{\graymult}{\dotmult{gray dot}}
\newcommand{\graycomult}{\dotcomult{gray dot}}
\newcommand{\graytickunit}{\dottickunit{gray dot}}
\newcommand{\graytickcounit}{\dottickcounit{gray dot}}
\newcommand{\graycap}{\dotcap{gray dot}}
\newcommand{\graycup}{\dotcup{gray dot}}

\newcommand{\grayobs}{\ensuremath{\mathcal O_{\!\smallgraydot}}\xspace}


\newcommand{\blacktranspose}{\ensuremath{{\,\blackdot\!\textrm{\rm\,T}}}}
\newcommand{\whitetranspose}{\ensuremath{{\!\!\altwhitedot\!\!}}}
\newcommand{\graytranspose}{\ensuremath{{\,\graydot\!\textrm{\rm\,T}}}}

\newcommand{\whiteconjugate}{\ensuremath{{\!\!\altwhitedot\!\!}}}

% \newcommand{\spider}[4][dot]{\node [#1] (#2) at (0,0) {};
% \node [bn] (#2_d1) at (-1,1) {};
% \node [bn] (#2_d2) at (-0.5,1) {};
% \node [bn] (#2_dm) at (1,1) {};
% \node [bn] (#2_c1) at (-1,-1) {};
% \node [bn] (#2_c2) at (-0.5,-1) {};
% \node [bn] (#2_cn) at (1,-1) {};

% \node [anchor=west] at (#2_dm.east) {$#3$};
% \node [anchor=west] at (#2_cn.east) {$#4$};
% \node at (0.2,0.7) {\small{...}};
% \node at (0.2,-0.7) {\small{...}};

% \draw (#2)--(#2_d1) (#2)--(#2_d2) (#2)--(#2_dm);
% \draw (#2)--(#2_c1) (#2)--(#2_c2) (#2)--(#2_cn);}

\newcommand{\circl}{\begin{tikzpicture}[dotpic]
		\node [style=none] (a) at (-0.25, 0.25) {};
		\node [style=none] (b) at (0.25, 0.25) {};
		\node [style=none] (c) at (-0.25, -0.25) {};
		\node [style=none] (d) at (0.25, -0.25) {};
		\draw [in=45, out=135] (b.center) to (a.center);
		\draw [in=135, out=225] (a.center) to (c.center);
		\draw [in=225, out=-45] (c.center) to (d.center);
		\draw [style=diredge, in=-45, out=45] (d.center) to (b.center);
\end{tikzpicture}}

% \newcommand{\icircl}{\begin{tikzpicture}[dotpic]
% 	\node [circle,draw=black,inner sep=1pt] {\footnotesize\sf{}{$-$}};
% \end{tikzpicture}}

% \newcommand{\rtcircl}{\ensuremath{\sqrt{\begin{tikzpicture}[dotpic]
% 	\node [circle,draw=black,inner sep=1pt] {\tiny\sf\phantom{$-$}};
% \end{tikzpicture}}}}
% \newcommand{\rticircl}{\ensuremath{\sqrt{\begin{tikzpicture}[dotpic]
% 	\node [circle,draw=black,inner sep=1pt] {\tiny\bf\sf{}{$-$}};
% \end{tikzpicture}}}}

% \newcommand{\dcircl}{\begin{tikzpicture}[dotpic]
% 	\draw [use as bounding box,draw=none] (-0.15,-0.3) rectangle (0.15,0.3);
% 	\node [small dot] (0) {};
% 	\draw [uploop] (0) to ();
% 	\draw [downloop] (0) to ();
% \end{tikzpicture}}
